<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>


<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<title>青麦门店系统|入库管理</title>
<meta
    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
    name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />

<!-- ================== BEGIN BASE CSS STYLE ================== -->
<%@ include file="../include/inc_head.jsp"%>
<!-- ================== END BASE CSS STYLE ================== -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="/assets/plugins/pace/pace.min.js"></script>
<!-- <link href="/assets/plugins/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet" /> -->
<script type="text/javascript"
	src="/assets/My97DatePicker/WdatePicker.js"></script>
<!-- ================== END BASE JS ================== -->
</head>
<style>
.pagination {
    display: block;
}
</style>
<body>
    <!-- begin #page-loader -->
    <div id="page-loader" class="fade in">
        <span class="spinner"></span>
    </div>
    <!-- end #page-loader -->

    <!-- begin #page-container -->
    <div id="page-container"
        class="fade page-sidebar-fixed page-header-fixed">
        <!-- begin #header -->
        <%@ include file="../include/inc_header.jsp"%>
        <!-- end #header -->

        <!-- begin #sidebar -->
        <%@ include file="../include/inc_left.jsp"%>
        <!-- end #sidebar -->

        <!-- begin #content -->
        <div id="content" class="content">
            <!-- begin breadcrumb -->
            <ol class="breadcrumb pull-right">
                <li><a href="javascript:;">首页</a></li>
                <li class="active">入库管理</li>
            </ol>
            <!-- end breadcrumb -->
            <!-- begin page-header -->
            <h1 class="page-header">入库管理</h1>
            <!-- end page-header -->

    <div class="panel panel-inverse">
                <div class="panel-heading">

                    <h4 class="panel-title">查询条件</h4>
                </div>
                <div class="panel-body">
                    <form class="form-inline" action="" method="POST">
                               
                               <!--  <div class="form-group m-r-10">
                                     <select class="form-control" id="className" name="className">
                                            <option value="-1">商品分类</option>
                                            <option value="1">冻品</option>
                                            <option value="2">猪肉</option>
                                            <option value="3">蔬菜</option>
                                            <option value="4">水产</option>
                                      </select>
                                </div> -->
                                 <div class="form-group m-r-10">
                                    <input type="text" class="form-control" id="procerementId"  placeholder="采购单ID" />
                                    <!--  <input type="text" class="form-control" id="shopId" placeholder="门店ID" /> -->
                                </div>
                                <div class="form-group m-r-10">
                                    <input id="s_time" name="s_time" class="Wdate" type="text" style="width: 110px" placeholder="日期开始"
                        onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',maxDate:'#F{$dp.$D(\'e_time\')||\'2020-10-01\'}'})" />
                                      - <input id="e_time" name="e_time" class="Wdate mr10" type="text" style="width: 110px" placeholder="日期结束"
                        onFocus="WdatePicker({minDate:'#F{$dp.$D(\'s_time\')}',dateFmt:'yyyy-MM-dd HH:mm',maxDate:'2020-10-01'})" />
                                
                                 </div>
                                <button type="button" class="btn btn-sm btn-inverse m-r-5" onclick="doSearch();">查询</button>
                                <button type="button" class="btn btn-sm btn-inverse m-r-5" onclick="exportInstockOrder();">导出入库单</button>
                            </form>
                    
                </div>
            </div>
            <div class="panel panel-inverse">
                <div class="panel-body">
                    <table id="data-table" class="table table-striped table-bordered">
                        
                    </table>
                </div>
            </div>

        </div>
        <!-- end #content -->

        <%@ include file="../include/inc_footer.jsp"%>
        <!-- begin scroll to top btn -->
        <a href="javascript:;"
            class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade"
            data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
        <!-- end scroll to top btn -->
    </div>
    <!-- end page container -->

    <!-- ================== BEGIN BASE JS ================== -->
    <%@ include file="../include/inc_foot.jsp"%>

    <!-- ================== END BASE JS ================== -->

    <!-- ================== BEGIN PAGE LEVEL JS ================== -->
    <script src="/assets/plugins/DataTables/media/js/jquery.dataTables.js"></script>
    <script src="/assets/plugins/DataTables/media/js/dataTables.bootstrap.min.js"></script>
    <script src="/assets/js/table-manage-default.demo.min.js"></script>
<!--     <script src="/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script src="/assets/plugins/bootstrap-datepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script> -->
    <script src="/assets/js/apps.min.js"></script>
    
    
    
<link rel="stylesheet" type="text/css" href="/assets/jQueryEasyui/themes/gray/easyui.css">  
<link rel="stylesheet" type="text/css" href="/assets/jQueryEasyui/themes/icon.css">  
<!-- <link rel="stylesheet" type="text/css" href="/assets/jQueryEasyui/style.css">  
<link rel="stylesheet" type="text/css"
    href="/assets/jQueryEasyui/demo.css">
    <link rel="stylesheet" type="text/css"
    href="/assets/jQueryEasyui/list.css"> -->   
<script type="text/javascript" src="/assets/jQueryEasyui/jquery.easyui.min.js"></script> 
<script type="text/javascript" src="/assets/jQueryEasyui/easyui-lang-zh_CN.js"></script> 

      <!--    <tr>
                                
                                 <tr>
                                    <td>申请人:<a href="#" style="margin-left: 30px;">刘兰</a></td>                                  
                                    <td style="width:320px;">采购状态:<a href="#" style="margin-left: 30px;">待入库</a></td>                                
                                </tr>
                                 <tr>
                                  <td>送货时间:<a href="#" style="margin-left: 30px;">2018-05-03 04:00:00</a></td>
                                    <td style="width:320px;">申请时间:<a href="#" style="margin-left: 30px;" >2018-05-02 12:00:00</a></td>
                                </tr> 
                                 -->
    <script>
    $(function() {

        var wid=window.screen.width;
        $('#data-table')
                .datagrid(
                        {
                            title : '入库管理',
                            loadMsg : '数据加载中,请稍后................',
                            nowrap : true,
                            striped : true,
                            url : '${ctx}/shop/stock/getIndex',
                            pagination : true,
                            rownumbers : true,
                            singleSelect : false,
                            border : true,
                            pageSize : '10',
                            columns : [ [
                                   /*  {
                                        field : 'check',
                                        checkbox : true
                                    }, */
                                    {
                                        field : 'id',
                                        title : '入库单ID',
                                        width :   wid*0.12,
                                        align : 'center'
                                    },
                                    {
                                        field : 'procerementId',
                                        title : '对应采购单ID',
                                        width :   wid*0.12,
                                        align : 'center'
                                    },
                                    {
                                        field : 'shopName',
                                        title : '申请商家',
                                        width :   wid*0.2,
                                        align : 'center'
                                    }, {
                                        field : 'ct',// 
                                        title : '入库时间',
                                        width :   wid*0.2,
                                        align : 'center'
                                    }, {
                                        field : 'tttt',
                                        title : '操作',
                                        align : 'center',
                                        width :   wid*0.2,
                                        formatter : function(value, rec, index) {
                                            var str ='<a href=${ctx}/shop/stock/instockDetail?id='+rec.id+'>查看详情</a>';
                                            str +='<a style="margin-left:20px;" href=${ctx}/shop/stock/add?id='+rec.id+'&&procurementOrderId='+rec.procerementId+'>修改</a>';
                                            return str;
                                        }
                                    } ] ]
                        });
     var p = $('#data-table').datagrid('getPager');
        $(p).pagination({
            pageSize : 10,
            pageList : [ 10, 20, 30 ]
        });  

        //获取活动分类
    });
    
        //查询
    function doSearch() {
        $('#data-table').datagrid('load', {
            procerementId : $("#procerementId").val(),
            s_time : $('#s_time').val(),
            e_time : $('#e_time').val()
        });
    }
    
    function exportInstockOrder(){
   			  var rows = $('#data-table').datagrid("getSelections");
		      if (rows.length == 0) {
		        $.messager.alert('提示', '请选择要导出的入库单!');
		        return;
		      }
		      if (rows.length > 1) {
		    	  $.messager.alert('提示', '只能选择单个入库单导出!');
		        return;
		      }
		  var procerementId=rows[0].procerementId;
		 window.location.href="/shop/stock/exportStockOrder?procerementId="+procerementId;
    }
    </script>
        <script>
        /* $(document).ready(function() {
            $("#startDate").datepicker({
                format: 'yyyy-mm-dd',
                language: "zh-CN",
                keyboardNavigation: false,
                forceParse: false,
                calendarWeeks: false,
                autoclose: true,
            });
            $("#endDate").datepicker({
                format: 'yyyy-mm-dd',
                language: "zh-CN",
                keyboardNavigation: false,
                forceParse: false,
                calendarWeeks: false,
                autoclose: true,
            });
            $("#startDate").on("changeDate",
            function(e) {
                $("#endDate").data("datepicker").setStartDate(e.date)
            });
            $("#endDate").on("changeDate",
            function(e) {
                $("#startDate").data("datepicker").setEndDate(e.date)
            });

        });  */
        App.init();
    </script>

</body>
</html>


